const state = {
    //所有样式存储
    theme: {}
}
//定义mutations,用于同步修改state中的值
const mutations = {
  SET_THEME(state, themeStyle) {
    state.theme = { ...state.theme, ...themeStyle };
  }
}
//定义actions,用于异步修改state中的值
const actions = {
  saveThemeStyle({ commit }, themeStyle) {
    commit('SET_THEME', themeStyle)
    // console.log('themeStyle', themeStyle)
  }
}
//定义getters,用于获取state中的值
const getters = {
  getThemeStyle : state => state.theme
}
export default {
  namespaced: true,  // 确保启用了命名空间
  name: 'themeStyle',
  state,
  mutations,
  actions,
  getters
}
